<template>
	
	<block v-if="loading">
		<empty :loading="true"></empty>
	</block>
	<block v-else>
		
		<form @submit="submit" :data-action="`/api/monitoringFacilities/save?stationId=${param.stationId}`">
				
				<view class="fixAuto bb middle">
					<view class="w100">
						站房面积
					</view>
					<view>
						<input v-if="!disabled" type="number" name="x.area|站房面积|amount"  v-model="data.area" :disabled="disabled" placeholder="请输入站房面积,单位:㎡">
						<view v-else>
							{{data.area}}
						</view>
					</view>
					<view class="w20">
						㎡
					</view>
				</view>
				<view class="fixAuto bb middle">
					<view class="w100">
						门禁方式
					</view>
					<view>
						<input type="text" name="x.controlMode|门禁方式|0~200"  v-model="data.controlMode" :disabled="disabled" placeholder="请输入门禁方式">
					</view>
				</view>
				<view class="fixAuto bb middle">
					<view class="w100">
						网络运营商
					</view>
					<view>
						<input type="text" name="x.newworkOperator|网络运营商|0~200"  v-model="data.newworkOperator" :disabled="disabled" placeholder="请输入网络运营商">
					</view>
				</view>
				<view class="fixAuto bb middle">
					<view class="w100">
						存储IP
					</view>
					<view>
						<input type="text" name="x.ip|存储IP|0~200"  v-model="data.ip" :disabled="disabled" placeholder="请输入存储IP">
					</view>
				</view>
				<view class="fixAuto bb middle">
					<view class="w100">
						排口视监控
					</view>
					<view>
						<input type="text" name="x.platoonIp|排口视频监控ip/编码|0~200"  v-model="data.platoonIp" :disabled="disabled" placeholder="请输入排口视频监控ip/编码">
					</view>
				</view>
				<view class="fixAuto bb middle">
					<view class="w100">
						站房视频监控
					</view>
					<view>
						<input type="text" name="x.stationIp|站房视频监控ip/编码|0~200"  v-model="data.stationIp" :disabled="disabled" placeholder="请输入站房视频监控ip/编码">
					</view>
				</view>
				<view class="fixAuto bb middle">
					<view class="w100">
						治污设施监控
					</view>
					<view>
						<input type="text" name="x.polutionIp|治污设施视频监控ip/编码|0~200"  v-model="data.polutionIp" :disabled="disabled" placeholder="请输入治污设施视频监控ip/编码">
					</view>
				</view>
				<view class="fixAuto bb middle">
					<view class="w100">
						其他视频监控
					</view>
					<view>
						<input type="text" name="x.otherIp|其他视频监控ip/编码|0~200"  v-model="data.otherIp" :disabled="disabled" placeholder="请输入其他视频监控ip/编码">
					</view>
				</view>
				<view class="fixAuto bb middle">
					<view class="w100">
						监管部门
					</view>
					<view>
						<input type="text" name="x.regulatoryAuthorities|监管部门|0~200"  v-model="data.regulatoryAuthorities" :disabled="disabled" placeholder="请输入监管部门">
					</view>
				</view>
				<view class="fixAuto bb middle">
					<view class="w100">
						行业
					</view>
					<view>
						<input type="text" name="x.industry|行业|0~200"  v-model="data.industry" :disabled="disabled" placeholder="请输入行业">
					</view>
				</view>
				
				<view class="plr100 pd30" v-if="!disabled">
					<button form-type="submit" class="btn block rds23">
						保存记录
					</button>
				</view>
			</form>
		
	</block>

	</layout>
</template>

<script>
	export default {
		data() {
			return {
				param:{stationId:""} ,
				data : {} ,
				disabled : true ,
				loading : true 
			}
		},
		onLoad(params) {
			this.param = params ;
			var role = uni.getStorageSync("role");
			this.disabled = role != 2 ;
			this.loadData();
		},
		methods: {
			
			loadData:function(e){
				var data = {id:this.param.stationId} ;
				this.kit.get("/api/monitoringFacilities/info",data,res => {
					this.data = res.data || {};
					this.loading = false ;
				});
			},
			
			submit:function(e){
				this.form.submit(e , this.success);
			},
			
			success:function(e){
				this.kit.goSuccessBack("保存成功");
			}
		}
	}
</script>
<style>
	page{
		background-color: #fff;
	}
</style>